package ru.aslanov.schedule.model;

import ru.aslanov.schedule.shared.SyncStatus;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * Created: Mar 3, 2010 5:36:22 PM
 *
 * @author Sergey Aslanov
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class GoogleCalendarSync extends Entity {
    @Persistent
    private String sessionToken;
    @Persistent
    private String authorizedByUser;
    @Persistent
    private Date lastPublishDate;
    @Persistent
    private String lastPublishErrors;
    @Persistent
    private SyncStatus syncStatus;

    @Persistent(mappedBy = "googleCalendarSync")
    private Schedule schedule;

    //@Persistent(mappedBy = "googleCalendarSync")
    //@Element(dependent = "true")
    //private List<GoogleCalendarSyncEvent> googleCalendarSyncEvents;

    public GoogleCalendarSync() {
    }

    public String getSessionToken() {
        return sessionToken;
    }

    public void setSessionToken(String sessionToken) {
        this.sessionToken = sessionToken;
    }

    public Date getLastPublishDate() {
        return lastPublishDate;
    }

    public void setLastPublishDate(Date lastPublishDate) {
        this.lastPublishDate = lastPublishDate;
    }

    public String getLastPublishErrors() {
        return lastPublishErrors;
    }

    public void setLastPublishErrors(String lastPublishErrors) {
        this.lastPublishErrors = lastPublishErrors;
    }

    public String getAuthorizedByUser() {
        return authorizedByUser;
    }

    public void setAuthorizedByUser(String authorizedByUser) {
        this.authorizedByUser = authorizedByUser;
    }

    //public List<GoogleCalendarSyncEvent> getGoogleCalendarSyncEvents() {
    //    return googleCalendarSyncEvents;
    //}

    //public void setGoogleCalendarSyncEvents(List<GoogleCalendarSyncEvent> googleCalendarSyncEvents) {
    //    this.googleCalendarSyncEvents = googleCalendarSyncEvents;
    //}

    public SyncStatus getSyncStatus() {
        return syncStatus;
    }

    public void setSyncStatus(SyncStatus syncStatus) {
        this.syncStatus = syncStatus;
    }

    public Schedule getSchedule() {
        return schedule;
    }

    public void setSchedule(Schedule schedule) {
        this.schedule = schedule;
    }

}
